package club.lovety.service.user.controller;

import club.lovety.service.user.facade.UserFacade;
import club.lovety.service.user.vo.UserVo;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RefreshScope
@RestController
public class UserController  implements UserFacade {

    @Value("${user.username}")
    private String username;

    @Override
    public Object loadUser(){
        UserVo userVo = new UserVo("博云",6);
        System.out.println("当前线程： "+ Thread.currentThread().getName()+", loaduser————11111");
        return userVo;
    }

    @RequestMapping("getusername")
    public String getUsername(){
        return "加载配置文件内容:  " +username;
    }
}
